package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.EmpExprMapper;
import com.itheima.pojo.EmpExpr;
import com.itheima.service.EmpExprService;
import com.itheima.service.EmpService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 李佳赢
 * @Date: 2025/9/13 - 09 - 13 - 10:45
 * @Description: com.itheima.service.impl
 * @version: 1.0
 */
@Service
public class EmpExprServiceImpl extends ServiceImpl<EmpExprMapper, EmpExpr> implements EmpExprService {
    @Override
    public void removeByEmIds(List<Integer> empIds) {
// 显式创建LambdaQueryWrapper对象
        LambdaQueryWrapper<EmpExpr> queryWrapper = new LambdaQueryWrapper<>();
        // 构造删除条件
        queryWrapper.in(EmpExpr::getEmpId, empIds);
        // 执行删除
        this.remove(queryWrapper);
    }

    @Override
    public List<EmpExpr> getByEmpId(Integer empId) {
        return list(new LambdaQueryWrapper<EmpExpr>().eq(EmpExpr::getEmpId,empId));
    }
}
